package a1_4;

/**
 * 支付方式抽象父类，包含金额属性
 */
public abstract class Payment {
    protected double amount; // 支付金额（protected：子类可访问）

    public Payment() {}

    public Payment(double amount) {
        this.amount = amount;
    }

    // 抽象方法：验证支付有效性（子类实现具体逻辑）
    public abstract boolean validatePayment();

    // Getter/Setter
    public double getAmount() {
        return amount;
    }

    public void setAmount(double amount) {
        this.amount = amount;
    }
}